#include<about.h>
AboutDialog::AboutDialog(QWidget *parent){

    this->setWindowTitle("关于A-star Map Editor");
    this->setWindowIcon(QIcon(":/icon/resource/logo.ico"));
    this->setWindowFlags(Qt::WindowCloseButtonHint);
    this->setFixedSize(540,240);


    QLabel *logo=new QLabel();
    logo->setFixedSize(100,100);
    logo->setPixmap(QPixmap(":/about/resource/logo.png").scaled(100,100,Qt::KeepAspectRatio,Qt::SmoothTransformation));
    logo->setAlignment(Qt::AlignCenter);

    QLabel *profile=new QLabel();
    profile->setFixedSize(100,100);
    profile->setPixmap(QPixmap(":/about/resource/profile.jpg").scaled(80,80,Qt::KeepAspectRatio,Qt::SmoothTransformation));
    profile->setAlignment(Qt::AlignCenter);

    QLabel *text1=new QLabel("A-star Map Editor V3.0");
    text1->setFont(QFont("SimSun",16));
    QLabel *text2=new QLabel("  一款基于Qt开发的具有A*寻路算法的可视化地图编辑器，欢迎到Github或B站关注。");
    text2->setFont(QFont("SimSun",12));
    text2->setWordWrap(true);
    QLabel *text3=new QLabel("作者:Radiant");
    text3->setFont(QFont("SimSun",12));


    QLabel *text4=new QLabel();
    QLabel *text5=new QLabel();
    QLabel *text6=new QLabel();

    text4->setOpenExternalLinks(true);
    text4->setText("<a style='color:#66CCFF;' href=\"https://github.com/RootEntertainment\">Github:@Rootentertainment");
    text4->setFont(QFont("SimSun",12));

    text5->setOpenExternalLinks(true);
    text5->setText("<a style='color:#66CCFF;' href=\"https://gitee.com/rootentertainment/a-star-map-editor\">Gitee:gitee.com/rootentertainment/a-star-map-editor");
    text5->setFont(QFont("SimSun",12));

    text6->setOpenExternalLinks(true);
    text6->setText("<a style='color:#66CCFF;' href=\"https://space.bilibili.com/19251655\">Bilibili:@嘉然今天吃kira");
    text6->setFont(QFont("SimSun",12));

    QVBoxLayout *layoutPic = new QVBoxLayout;
    layoutPic->setAlignment(Qt::AlignRight);
    layoutPic->addWidget(logo);
    layoutPic->addStretch();
    layoutPic->addWidget(profile);

    QVBoxLayout *layoutText = new QVBoxLayout;

    layoutText->addWidget(text1);
    layoutText->addStretch();
    layoutText->addWidget(text2);
    layoutText->addStretch();
    layoutText->addWidget(text3);
    layoutText->addWidget(text4);
    layoutText->addWidget(text5);
    layoutText->addWidget(text6);

    layoutText->setAlignment(Qt::AlignTop);


    QHBoxLayout *aboutlayout = new QHBoxLayout(this);
    aboutlayout->addLayout(layoutPic);
    aboutlayout->addLayout(layoutText);

}
